package kuzha.code.script;

import kuzha.KuzhaObject;
import kuzha.ast.Statement;
import kuzha.code.CodeBlock;

public class ScriptCodeBlock extends CodeBlock {
	public final Statement script;
	
	public ScriptCodeBlock(Statement script) {
		if (script == null)
			throw new IllegalArgumentException();
		this.script = script;
	}
	
	@Override
	public KuzhaObject exec(KuzhaObject locals) {
		return new Evaluator().eval(script, locals);
	}
}
